package com.walter.common.exception;

import lombok.Getter;

import java.util.Optional;

/**
 * @author Walter
 * @date 2025/1/20 上午11:27
 **/
@Getter
public abstract class AbstractException extends RuntimeException{
    private final Integer code;
    private final String message;
    public AbstractException(AppHttpCodeEnum appHttpCodeEnum, String message,Throwable throwable){
        super(message,throwable);
        this.code = appHttpCodeEnum.getCode();
        this.message = Optional.ofNullable(message).orElse(appHttpCodeEnum.getMessage());    }
}
